<%@ LANGUAGE="VBSCRIPT" %>
<%
	if Instr(Session("VanBan"),"-"& request("bMa") &"-")=0 or Session("VanBan")="" then
		Response.Redirect(Session("URL")& "Error.asp?ErrorCode=3")
	end if
	Session("Attach")=""
%>
<!--#include file="..\RootContent.inc"-->
<!--#include file="..\CheckSession.inc"-->
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<Title>Selab Net Office</title>
<Body>
<%
	bID=request("bMa")
	bLoaiVT=Request("LoaiVT")
	Select Case bLoaiVT
		'******Van ban den*******************
		Case "1"
			sSQL="select vtden.*,ykxl_hxl.hanxuly as hanxulys,ykxl_hxl.nbdxuly as nbdxulys from vtden left outer join ykxl_hxl on vtden.id=ykxl_hxl.idvtden and ykxl_hxl.madonvi='"& Session("bMaDonVi") &"' where vtden.ID like '"& bID &"'"
			Set RecT=Server.CreateObject("ADODB.Recordset")
			RecT.CursorType=3
			RecT.CacheSize=5
			RecT.Open sSQL,Conn
			if RecT.RecordCount>0 then
				bNgaynhan=RecT("Ngaynhan")
				bSoghinhan=RecT("soghinhan")		
				bDoitac=RecT("Doitac")
				bSogoc=RecT("Sogoc")
				bNgayky=RecT("Ngayky")
				bNguoiky=RecT("Nguoiky")
				bTrichyeu=RecT("Trichyeu")

				bTomtat=RecT("tomtat")
				bNoinhan=RecT("Noinhan")

				bTinhchat=RecT("Tinhchat")
				bPhanloai=RecT("phanloai")
				bTentep=RecT("Tentep")
				bTukhoa=RecT("Tukhoa")
				bDiachiluutru=RecT("diachiluutru")
				bnbd=RecT("nbdxulys")
				bhxl=RecT("hanxulys")
			end if
			'response.write "<br>"
			RecT.Close
			set RecT=nothing
				
			wCol1="20%"
			wCol2="30%"
			wCol3="25%"
			wCol4="25%"
			'Tim  #9900CC
		%>
		<table border="1" cellpadding="1" cellspacing="0" style="border-collapse: collapse" bordercolor="#008000" width="100%">
		<tr>
			<td bgcolor="#000080" colspan=4 align="center"><b>
			<font size="2" face="Arial" color="#FFFFFF">THÔNG TIN VĂN BẢN</font></b></td>
		</tr>
		<tr>
			<td bgcolor="#F9F9FF" width=<%=wCol1%>><b>
			<font size="2" face="Arial" color="black"><%= write("Ngày đến: ","",0)%></font></b></td>
			<td bgcolor="#F9F9FF" width=<%=wCol2%>><b>
			<font size="2" face="Arial" color="black"><%=write(FormatDate(bNgaynhan),"blue",1)%></font></b></td>
			<td bgcolor="#F9F9FF" width=<%=wCol3%>><b>
			<font size="2" face="Arial" color="black"><%=write("Ngày văn bản: ","",0)%></font></b></td>
			<td bgcolor="#F9F9FF"  width=<%=wCol4%>><b>
			<font size="2" face="Arial" color="black"><%=write(FormatDate(bNgayky),"blue",1)%></font></b></td>
		</tr>

		<tr>
			<td bgcolor="#F9F9FF" width=<%=wCol1%>><b>
			<font size="2" face="Arial" color="black"><%= write("Số đến: ","",0)%></font></b></td>
			<td bgcolor="#F9F9FF"  width=<%=wCol2%>><b>
			<font size="2" face="Arial" color="black"><%=write(bSoghinhan,"blue",1)%></font></b></td>
			<td bgcolor="#F9F9FF" width=<%=wCol3%>><b>
			<font size="2" face="Arial" color="black"><%=write("Số, ký hiệu văn bản: ","",0)%></font></b></td>
			<td bgcolor="#F9F9FF"  width=<%=wCol4%>><b>
			<font size="2" face="Arial" color="black"><%=write(bSogoc,"blue",1)%></font></b></td>
		</tr>
			
		<tr>
			<td bgcolor="#F9F9FF" width=<%=wCol1%>><b>
			<font size="2" face="Arial" color="black"><%= write("Độ mật: ","",0)%></font></b></td>
			<td bgcolor="#F9F9FF"  width=<%=wCol2%>><b>
			<font size="2" face="Arial" color="black"><%=write(GetName("ma","ten","tinhchat",bTinhchat),"blue",1)%></font></b></td>
			<td bgcolor="#F9F9FF" width=<%=wCol3%>><b>
			<font size="2" face="Arial" color="black"><%=write("Tên loại văn bản: ","",0)%></font></b></td>
			<td bgcolor="#F9F9FF"  width=<%=wCol4%>><b>
			<font size="2" face="Arial" color="black"><%=write(GetName("idloai","ten_hinh_thuc","phan_loai_vb",bPhanloai),"blue",1)	%></font></b></td>
		</tr>
		<tr>
			<td bgcolor="#F9F9FF" width=<%=wCol1%>><b>
			<font size="2" face="Arial" color="black"><%= write("Nơi gửi văn bản: ","",0)%></font></b></td>
			<td bgcolor="#F9F9FF"  width=<%=wCol2%>><b>
			<font size="2" face="Arial" color="black"><%=write(bDoitac,"blue",1)%></font></b></td>
			<td bgcolor="#F9F9FF" width=<%=wCol3%>><b>
			<font size="2" face="Arial" color="black"><%= write("Người ký: ","",0)%></font></b></td>
			<td bgcolor="#F9F9FF"  width=<%=wCol4%>><b>
			<font size="2" face="Arial" color="black"><%=write(bNguoiky,"blue",1)%></font></b></td>
		</tr>
			
		<tr>
			<td bgcolor="#F9F9FF" width=<%=wCol1%>><b>
			<font size="2" face="Arial" color="black"><%= write("Trích yếu: ","",0)%></font></b></td>
			<td bgcolor="#F9F9FF" colspan=3><b>
			<font size="2" face="Arial" color="black"><%=write(bTrichyeu,"blue",1)%></font></b></td>
		</tr>

		<%if bTomtat <>"" then %>
			<tr>
				<td bgcolor="#F9F9FF" width=<%=wCol1%>><b>
				<font size="2" face="Arial" color="black"><%= write("Tóm tắt nội dung: ","",0)%></font></b></td>
				<td bgcolor="#F9F9FF"  colspan=3><b>
				<font size="2" face="Arial" color="black"><%=write(bTomtat,"blue",1)%></font></b></td>
			</tr>	
		<%end if%>

		<tr>
			<%if bNoinhan<>"" then %>	
				<td bgcolor="#F9F9FF" width=<%=wCol1%>><b>
				<font size="2" face="Arial" color="black"><%= write("Đơn vị xử lý: ","",0)%></font></b></td>
				<td bgcolor="#F9F9FF" width=<%=wCol2%>><b>
				<font size="2" face="Arial" color="black"><%=write(bNoinhan,"blue",1)%></font></b></td>
			<%end if%>
					
			<%if bDiachiluutru<>"" then %>
				<td bgcolor="#F9F9FF" width=<%=wCol3%>><b>
				<font size="2" face="Arial" color="black"><%= write("Địa chỉ lưu trữ: ","",0)%></font></b></td>
				<td bgcolor="#F9F9FF" width=<%=wCol4%>><b>
				<font size="2" face="Arial" color="black"><%=write(GetName("idluutru","ten","diachiluutru",bDiachiluutru),"blue",1)%></font></b></td>
			</tr>
			<%end if%>
			<%if bhxl then%>
			<tr>
				<td bgcolor="#F9F9FF" width=<%=wCol1%>><b>
				<font size="2" face="Arial" color="black"><%= write("Ngày bắt đầu xử lý: ","",0)%></font></b></td>
				<td bgcolor="#F9F9FF" width=<%=wCol2%>><b>
				<font size="2" face="Arial" color="black"><%=write(FormatDate(bnbd),"blue",1)%></font></b></td>
				<td bgcolor="#F9F9FF" width=<%=wCol3%>><b>
				<font size="2" face="Arial" color="black"><%= write("Hạn xử lý : ","",0)%></font></b></td>
				<td bgcolor="#F9F9FF" width=<%=wCol4%>><b>
				<font size="2" face="Arial" color="black"><%=write(FormatDate(bhxl),"blue",1)%></font></b></td>
			</tr>
			<%end if%>
		</table>
	<%Case "2"		'VTDi
		sSQL="Select * from VTDi Where ID Like '"& bID &"'"
		Set RecT=Server.CreateObject("ADODB.Recordset")
		RecT.CursorType=3
		RecT.CacheSize=5
		RecT.Open sSQL,Conn
		if RecT.RecordCount>0 then
			bNGayky=RecT("Ngayky")
			bSoghinhan=trim(RecT("soghinhan"))
			bSelect1=rect("DVSoan")
			bNguoiky=RecT("Nguoiky")
			bTrichyeu=RecT("Trichyeu")
			bTomtat=trim(RecT("Tomtat"))
			bTinhchat=RecT("Tinhchat")
			bSoban=RecT("Soban")
			bSoto=RecT("Soto")
			bNoinhan=RecT("Noinhan")
			bDiachiluutru=RecT("diachiluutru")

			bOutNum=cstr(RecT("so"))
			bOutSymbol=right(bSoghinhan,len(bSoghinhan)-len(bOutNum)-1)
			bTentep=RecT("Tentep")
			bNgaydi=RecT("Ngaydi")
			bNguoinhan=RecT("Nguoinhan")
			bTukhoa=RecT("Tukhoa")
			bTTDuyet=RecT("trangthaiduyet")
			bPhanloai=RecT("phanLoai")
		end if
		RecT.Close
		set RecT=nothing

		wCol1="20%"
		wCol2="30%"
		wCol3="25%"
		wCol4="25%"

	%>
		<table border="1" cellpadding="1" cellspacing="0" style="border-collapse: collapse" bordercolor="#008000" width="100%">
		<tr>
			<td bgcolor="#000080" colspan=4 align="center"><b>
			<font size="2" face="Arial" color="#FFFFFF">THÔNG TIN VĂN BẢN</font></b></td>
		</tr>
		<tr>
			<td bgcolor="#F9F9FF" width=<%=wCol1%>><b>
			<font size="2" face="Arial" color="black"><%= write("Ngày ký văn bản: ","",0)%></font></b></td>
			<td bgcolor="#F9F9FF" width=<%=wCol2%>><b>
			<font size="2" face="Arial" color="black"><%=write(FormatDate(bNGayky),"blue",1)%></font></b></td>
			<td bgcolor="#F9F9FF" width=<%=wCol3%>><b>
			<font size="2" face="Arial" color="black"><%=write("Số, ký hiệu văn bản: ","",0)%></font></b></td>
			<td bgcolor="#F9F9FF"  width=<%=wCol4%>><b>
			<font size="2" face="Arial" color="black"><%=write(bSoghinhan,"blue",1)%></font></b></td>
		</tr>
		<tr>
			<td bgcolor="#F9F9FF" width=<%=wCol1%>><b>
			<font size="2" face="Arial" color="black"><%= write("Đơn vị soạn: ","",0)%></font></b></td>
			<td bgcolor="#F9F9FF" width=<%=wCol2%>><b>
			<font size="2" face="Arial" color="black"><%=write(bSelect1,"blue",1)%></font></b></td>
			<td bgcolor="#F9F9FF" width=<%=wCol3%>><b>
			<font size="2" face="Arial" color="black"><%=write("Người ký văn bản: ","",0)%></font></b></td>
			<td bgcolor="#F9F9FF"  width=<%=wCol4%>><b>
			<font size="2" face="Arial" color="black"><%=write(bNguoiky,"blue",1)%></font></b></td>
		</tr>
		<tr>
			<td bgcolor="#F9F9FF" width=<%=wCol1%>><b>
			<font size="2" face="Arial" color="black"><%= write("Độ mật: ","",0)%></font></b></td>
			<td bgcolor="#F9F9FF"  width=<%=wCol2%>><b>
			<font size="2" face="Arial" color="black"><%=write(GetName("ma","ten","tinhchat",bTinhchat),"blue",1)%></font></b></td>
			<td bgcolor="#F9F9FF" width=<%=wCol3%>><b>
			<font size="2" face="Arial" color="black"><%=write("Số bản/Số tờ: ","",0)%></font></b></td>
			<td bgcolor="#F9F9FF"  width=<%=wCol4%>><b>
			<font size="2" face="Arial" color="black"><%=write(bSoban,"blue",0)	%><%=write("/","blue",0)	%><%=write(bSoto,"blue",1)	%></font></b></td>
		</tr>

		<tr>
			<td bgcolor="#F9F9FF" width=<%=wCol1%>><b>
			<font size="2" face="Arial" color="black"><%= write("Trích yếu: ","",0)%></font></b></td>
			<td bgcolor="#F9F9FF" colspan=3><b>
			<font size="2" face="Arial" color="black"><%=write(bTrichyeu,"blue",1)%></font></b></td>
		</tr>

		<%if bTomtat <>"" then %>
			<tr>
				<td bgcolor="#F9F9FF" width=<%=wCol1%>><b>
				<font size="2" face="Arial" color="black"><%= write("Tóm tắt nội dung: ","",0)%></font></b></td>
				<td bgcolor="#F9F9FF"  colspan=3><b>
				<font size="2" face="Arial" color="black"><%=write(bTomtat,"blue",1)%></font></b></td>
			</tr>	
		<%end if%>

		<tr>
			<%if bNoinhan<>"" then %>	
				<td bgcolor="#F9F9FF" width=<%=wCol1%>><b>
				<font size="2" face="Arial" color="black"><%= write("Đơn vị xử lý: ","",0)%></font></b></td>
				<td bgcolor="#F9F9FF" width=<%=wCol2%>><b>
				<font size="2" face="Arial" color="black"><%=write(bNoinhan,"blue",1)%></font></b></td>
			<%end if%>
					
			<%if bDiachiluutru<>"" then %>
				<td bgcolor="#F9F9FF" width=<%=wCol3%>><b>
				<font size="2" face="Arial" color="black"><%= write("Địa chỉ lưu trữ: ","",0)%></font></b></td>
				<td bgcolor="#F9F9FF" width=<%=wCol4%>><b>
				<font size="2" face="Arial" color="black"><%=write(GetName("idluutru","ten","diachiluutru",bDiachiluutru),"blue",1)%></font></b></td>
			<%end if%>	
		</tr>
		</table>
		<%Case "4"	'Noi bo
			sSQL="Select * from VTNoibo Where IDNoibo Like '"& bID &"'"
			Set RecT=Server.CreateObject("ADODB.Recordset")
			RecT.CursorType=3
			RecT.CacheSize=5
			RecT.Open sSQL,Conn
			if RecT.RecordCount>0 then
				bNgaytao=RecT("Ngayky")
				bSoghinhan=RecT("soghinhan")	

				bNguoitao=RecT("Nguoiky")
				bDiachiluutru=RecT("Diachiluutru")

				bTrichyeu=RecT("Trichyeu")

				bTentep=RecT("Tentep")
				bTukhoa=RecT("Tukhoa")
				bQuyen=RecT("Quyen")
				bTrangthai=RecT("Trangthai")			
				bThoihan=RecT("Thoihan")
				bVinhvien=RecT("Vinhvien")		
			end if
			RecT.Close
			set RecT=nothing

			wCol1="20%"
			wCol2="30%"
			wCol3="25%"
			wCol4="25%"
		%>
		<table border="1" cellpadding="1" cellspacing="0" style="border-collapse: collapse" bordercolor="#008000" width="100%">
		<tr>
			<td bgcolor="#000080" colspan=4 align="center"><b>
			<font size="2" face="Arial" color="#FFFFFF">THÔNG TIN VĂN BẢN</font></b></td>
		</tr>
		<tr>
			<td bgcolor="#F9F9FF" width=<%=wCol1%>><b>
			<font size="2" face="Arial" color="black"><%= write("Ngày tạo văn bản: ","",0)%></font></b></td>
			<td bgcolor="#F9F9FF" width=<%=wCol2%>><b>
			<font size="2" face="Arial" color="black"><%=write(FormatDate(bNgaytao),"blue",1)%></font></b></td>
			<td bgcolor="#F9F9FF" width=<%=wCol3%>><b>
			<font size="2" face="Arial" color="black"><%= write("Số, ký hiệu văn bản: ","",0)%></font></b></td>
			<td bgcolor="#F9F9FF"  width=<%=wCol4%>><b>
			<font size="2" face="Arial" color="black"><%=write(bSoghinhan,"blue",1)%></font></b></td>
		</tr>
		<tr>
			<td bgcolor="#F9F9FF" width=<%=wCol1%>><b>
			<font size="2" face="Arial" color="black"><%=write("Người tạo văn bản: ","",0)%></font></b></td>
			<td bgcolor="#F9F9FF" width=<%=wCol2%>><b>
			<font size="2" face="Arial" color="black"><%=write(bNguoitao,"blue",1)%></font></b></td>
			<td bgcolor="#F9F9FF" width=<%=wCol3%>><b>
			<font size="2" face="Arial" color="black"><%=write("Địa chỉ lưu trữ: ","",0)%></font></b></td>
			<td bgcolor="#F9F9FF"  width=<%=wCol4%>><b>
			<font size="2" face="Arial" color="black"><%=write(bDiachiluutru,"blue",1)%></font></b></td>
		</tr>
		<tr>
			<td bgcolor="#F9F9FF" width=<%=wCol1%>><b>
			<font size="2" face="Arial" color="black"><%= write("Trích yếu: ","",0)%></font></b></td>
			<td bgcolor="#F9F9FF" colspan=3><b>
			<font size="2" face="Arial" color="black"><%=write(bTrichyeu,"blue",1)%></font></b></td>
		</tr>
		</table>
	<%Case "5"		'VTQD
		sSQL="Select * from VTQuyetdinh Where ID Like '"& bID &"'"
		Set RecT=Server.CreateObject("ADODB.Recordset")
		RecT.CursorType=3
		RecT.CacheSize=5
		RecT.Open sSQL,Conn
		if RecT.RecordCount>0 then
			bNGayky=RecT("Ngayky")
			bSoghinhan=trim(RecT("soghinhan"))
			bSelect1=rect("DVSoan")
			bNguoiky=RecT("Nguoiky")
			bTrichyeu=RecT("Trichyeu")
			bTomtat=trim(RecT("Tomtat"))
			bTinhchat=RecT("Tinhchat")
			bSoban=RecT("Soban")
			bSoto=RecT("Soto")
			bNoinhan=RecT("Noinhan")
			bDiachiluutru=RecT("diachiluutru")

			bOutNum=cstr(RecT("so"))
			bOutSymbol=right(bSoghinhan,len(bSoghinhan)-len(bOutNum)-1)
			bTentep=RecT("Tentep")
			bNGaydi=RecT("Ngaydi")
			bNguoinhan=RecT("Nguoinhan")
			bTukhoa=RecT("Tukhoa")
			bTTDuyet=RecT("trangthaiduyet")
			bPhanloai=RecT("phanLoai")
		end if
		RecT.Close
		set RecT=nothing

		wCol1="20%"
		wCol2="30%"
		wCol3="25%"
		wCol4="25%"

	%>
		<table border="1" cellpadding="1" cellspacing="0" style="border-collapse: collapse" bordercolor="#008000" width="100%">
		<tr>
			<td bgcolor="#000080" colspan=4 align="center"><b>
			<font size="2" face="Arial" color="#FFFFFF">THÔNG TIN VĂN BẢN</font></b></td>
		</tr>
		<tr>
			<td bgcolor="#F9F9FF" width=<%=wCol1%>><b>
			<font size="2" face="Arial" color="black"><%= write("Ngày ký văn bản: ","",0)%></font></b></td>
			<td bgcolor="#F9F9FF" width=<%=wCol2%>><b>
			<font size="2" face="Arial" color="black"><%=write(FormatDate(bNGayky),"blue",1)%></font></b></td>
			<td bgcolor="#F9F9FF" width=<%=wCol3%>><b>
			<font size="2" face="Arial" color="black"><%=write("Số, ký hiệu văn bản: ","",0)%></font></b></td>
			<td bgcolor="#F9F9FF"  width=<%=wCol4%>><b>
			<font size="2" face="Arial" color="black"><%=write(bSoghinhan,"blue",1)%></font></b></td>
		</tr>
		<tr>
			<td bgcolor="#F9F9FF" width=<%=wCol1%>><b>
			<font size="2" face="Arial" color="black"><%= write("Đơn vị soạn: ","",0)%></font></b></td>
			<td bgcolor="#F9F9FF" width=<%=wCol2%>><b>
			<font size="2" face="Arial" color="black"><%=write(bSelect1,"blue",1)%></font></b></td>
			<td bgcolor="#F9F9FF" width=<%=wCol3%>><b>
			<font size="2" face="Arial" color="black"><%=write("Người ký văn bản: ","",0)%></font></b></td>
			<td bgcolor="#F9F9FF"  width=<%=wCol4%>><b>
			<font size="2" face="Arial" color="black"><%=write(bNguoiky,"blue",1)%></font></b></td>
		</tr>
		<tr>
			<td bgcolor="#F9F9FF" width=<%=wCol1%>><b>
			<font size="2" face="Arial" color="black"><%= write("Độ mật: ","",0)%></font></b></td>
			<td bgcolor="#F9F9FF"  width=<%=wCol2%>><b>
			<font size="2" face="Arial" color="black"><%=write(GetName("ma","ten","tinhchat",bTinhchat),"blue",1)%></font></b></td>
			<td bgcolor="#F9F9FF" width=<%=wCol3%>><b>
			<font size="2" face="Arial" color="black"><%=write("Số bản/Số tờ: ","",0)%></font></b></td>
			<td bgcolor="#F9F9FF"  width=<%=wCol4%>><b>
			<font size="2" face="Arial" color="black"><%=write(bSoban,"blue",0)	%><%=write("/","blue",0)	%><%=write(bSoto,"blue",1)	%></font></b></td>
		</tr>

		<tr>
			<td bgcolor="#F9F9FF" width=<%=wCol1%>><b>
			<font size="2" face="Arial" color="black"><%= write("Trích yếu: ","",0)%></font></b></td>
			<td bgcolor="#F9F9FF" colspan=3><b>
			<font size="2" face="Arial" color="black"><%=write(bTrichyeu,"blue",1)%></font></b></td>
		</tr>

		<%if bTomtat <>"" then %>
			<tr>
				<td bgcolor="#F9F9FF" width=<%=wCol1%>><b>
				<font size="2" face="Arial" color="black"><%= write("Tóm tắt nội dung: ","",0)%></font></b></td>
				<td bgcolor="#F9F9FF"  colspan=3><b>
				<font size="2" face="Arial" color="black"><%=write(bTomtat,"blue",1)%></font></b></td>
			</tr>	
		<%end if%>

		<tr>
			<%if bNoinhan<>"" then %>	
				<td bgcolor="#F9F9FF" width=<%=wCol1%>><b>
				<font size="2" face="Arial" color="black"><%= write("Đơn vị xử lý: ","",0)%></font></b></td>
				<td bgcolor="#F9F9FF" width=<%=wCol2%>><b>
				<font size="2" face="Arial" color="black"><%=write(bNoinhan,"blue",1)%></font></b></td>
			<%end if%>
					
			<%if bDiachiluutru<>"" then %>
				<td bgcolor="#F9F9FF" width=<%=wCol3%>><b>
				<font size="2" face="Arial" color="black"><%= write("Địa chỉ lưu trữ: ","",0)%></font></b></td>
				<td bgcolor="#F9F9FF" width=<%=wCol4%>><b>
				<font size="2" face="Arial" color="black"><%=write(GetName("idluutru","ten","diachiluutru",bDiachiluutru),"blue",1)%></font></b></td>
			<%end if%>	
		</tr>
		</table>
<!-- Hien25_06 -->
	<%Case "7"		'ToTrinh
		sSQL="Select * from ToTrinh Where ID ='"& bID &"'"
		Set RecT=Server.CreateObject("ADODB.Recordset")
		RecT.CursorType=3
		RecT.CacheSize=5
		RecT.Open sSQL,Conn
		if RecT.RecordCount>0 then
			bNgayden=RecT("Ngayden")
			bSoden=trim(RecT("Soden"))
			bNgayky=RecT("Ngayky")
			bSokyhieu=RecT("Sokyhieu")
			bNoigui=RecT("Noigui")
			bNguoinhan=RecT("Nguoinhan")
			bTrichyeu=RecT("Trichyeu")
			bYkien=RecT("Ykienchidao")
			bDonviXL=RecT("TenDVXL")
			bHanXL=RecT("HanXL")
		end if
		RecT.Close
		set RecT=nothing

		wCol1="20%"
		wCol2="30%"
		wCol3="25%"
		wCol4="25%"

	%>
		<table border="1" cellpadding="1" cellspacing="0" style="border-collapse: collapse" bordercolor="#008000" width="100%">
		<tr>
			<td bgcolor="#000080" colspan=4 align="center"><b>
			<font size="2" face="Arial" color="#FFFFFF">THÔNG TIN VĂN BẢN</font></b></td>
		</tr>
		<tr>
			<td bgcolor="#F9F9FF" width=<%=wCol1%>><b>
			<font size="2" face="Arial" color="black"><%= write("Ngày đến: ","",0)%></font></b></td>
			<td bgcolor="#F9F9FF" width=<%=wCol2%>><b>
			<font size="2" face="Arial" color="black"><%=write(FormatDate(bNgayden),"blue",1)%></font></b></td>
			<td bgcolor="#F9F9FF" width=<%=wCol3%>><b>
			<font size="2" face="Arial" color="black"><%=write("Ngày ký: ","",0)%></font></b></td>
			<td bgcolor="#F9F9FF"  width=<%=wCol4%>><b>
			<font size="2" face="Arial" color="black"><%=write(FormatDate(bNgayky),"blue",1)%></font></b></td>
		</tr>
		<tr>
			<td bgcolor="#F9F9FF" width=<%=wCol1%>><b>
			<font size="2" face="Arial" color="black"><%= write("Số đến: ","",0)%></font></b></td>
			<td bgcolor="#F9F9FF" width=<%=wCol2%>><b>
			<font size="2" face="Arial" color="black"><%=write(bSoden,"blue",1)%></font></b></td>
			<td bgcolor="#F9F9FF" width=<%=wCol3%>><b>
			<font size="2" face="Arial" color="black"><%=write("Số, ký hiệu: ","",0)%></font></b></td>
			<td bgcolor="#F9F9FF"  width=<%=wCol4%>><b>
			<font size="2" face="Arial" color="black"><%=write(bSokyhieu,"blue",1)%></font></b></td>
		</tr>
		<tr>
			<td bgcolor="#F9F9FF" width=<%=wCol1%>><b>
			<font size="2" face="Arial" color="black"><%= write("Nơi gửi: ","",0)%></font></b></td>
			<td bgcolor="#F9F9FF" width=<%=wCol2%>><b>
			<font size="2" face="Arial" color="black"><%=write(bNoigui,"blue",1)%></font></b></td>
			<td bgcolor="#F9F9FF" width=<%=wCol3%>><b>
			<font size="2" face="Arial" color="black"><%=write("Nơi, người nhận: ","",0)%></font></b></td>
			<td bgcolor="#F9F9FF"  width=<%=wCol4%>><b>
			<font size="2" face="Arial" color="black"><%=write(bNguoinhan,"blue",1)%></font></b></td>
		</tr>
		<tr>
			<td bgcolor="#F9F9FF" width=<%=wCol1%>><b>
			<font size="2" face="Arial" color="black"><%= write("Trích yếu nội dung: ","",0)%></font></b></td>
			<td bgcolor="#F9F9FF" colspan=3><b>
			<font size="2" face="Arial" color="black"><%=write(bTrichyeu,"blue",1)%></font></b></td>
		</tr>
		<tr>
			<td bgcolor="#F9F9FF" width=<%=wCol1%>><b>
			<font size="2" face="Arial" color="black"><%= write("Ý kiến chỉ đạo: ","",0)%></font></b></td>
			<td bgcolor="#F9F9FF" colspan=3><b>
			<font size="2" face="Arial" color="black"><%=write(bYkien,"blue",1)%></font></b></td>
		</tr>
		<tr>
			<td bgcolor="#F9F9FF" width=<%=wCol1%>><b>
			<font size="2" face="Arial" color="black"><%= write("Đơn vị xử lý: ","",0)%></font></b></td>
			<td bgcolor="#F9F9FF" width=<%=wCol2%>><b>
			<font size="2" face="Arial" color="black"><%=write(bDonviXL,"blue",1)%></font></b></td>
			<td bgcolor="#F9F9FF" width=<%=wCol3%>><b>
			<font size="2" face="Arial" color="black"><%=write("Hạn xử lý: ","",0)%></font></b></td>
			<td bgcolor="#F9F9FF"  width=<%=wCol4%>><b>
			<font size="2" face="Arial" color="black"><%=write(bHanXL,"blue",1)%></font></b></td>
		</tr>
	</table>
	<%End Select%>

<%
	bFileName=request("Tentep")
	bLoaiVT=Request("LoaiVT")
	bMa=request("bMa")
	bNam=Request("bNam")
	Set File = Server.CreateObject("ActiveFile.File")
	Select Case bLoaiVT
		'******Van ban den*******************
		Case "1"
			File.Name = RootContent & "Upload\"& cstr(bNam) &"\den\TEXT\"& bMa & ".VT"
			f=RootContent & "Upload\"& cstr(bNam) &"\Den\TEXT\"& bMa & ".VT"			
			Path=RootContent &"Upload\"& cstr(bNam) &"\Den\TEXT\"& bMa & ".VT"
			PathAttach=RootContent & "Upload\"& cstr(bNam) &"\den\"			
		'******Van ban di*******************
'Hien 21_05
		Case "2"
			File.Name = RootContent & "Upload\"& cstr(bNam) &"\di\TEXT\"& Replace(bMa,"/","_") & ".VT"
			f=RootContent & "Upload\"& cstr(bNam) &"\Di\TEXT\"& Replace(bMa,"/","_")& ".VT"
			Path= RootContent & "Upload\"& cstr(bNam) &"\Di\TEXT\"& Replace(bMa,"/","_")& ".VT"
			PathAttach=RootContent & "Upload\"& cstr(bNam) &"\di\"
		Case "3"
		'******Van ban du thao*******************
			File.Name =RootContent & "Upload\"& cstr(bNam) &"\duthao\TEXT\"& replace(bMa,"/","_") & ".VT"
			f=RootContent &"Upload\"& cstr(bNam) &"\Duthao\TEXT\"& replace(bMa,"/","_") & ".VT"			
			Path=RootContent & "Upload\"& cstr(bNam) &"\Duthao\TEXT\"& replace(bMa,"/","_") & ".VT"
			PathAttach=RootContent &"Upload\"& cstr(bNam) &"\duthao\"
		'******Van ban Noi bo*******************
		Case "4"
			File.Name = RootContent &"Upload\"& cstr(bNam) &"\Noibo\TEXT\"& bMa & ".VT"
			f=RootContent &"Upload\"& cstr(bNam) &"\Noibo\TEXT\"& bMa & ".VT"			
			Path=RootContent &"Upload\"& cstr(bNam) &"\Noibo\TEXT" & "\"& bMa & ".VT"			
			PathAttach=RootContent &"Upload\"& cstr(bNam) &"\noibo\"
'Hien 22_05
		Case "5" 'Quyet dinh
			File.Name = RootContent &"Upload\"& cstr(bNam) &"\Quyetdinh\TEXT\"& replace(bMa,"/","_") & ".VT"
			f=RootContent &"Upload\"& cstr(bNam) &"\Quyetdinh\TEXT\"& replace(bMa,"/","_") & ".VT"			
			Path=RootContent &"Upload\"& cstr(bNam) &"\Quyetdinh\TEXT" & "\"& replace(bMa,"/","_") & ".VT"
			PathAttach=RootContent &"Upload\"& cstr(bNam) &"\Quyetdinh\"
		Case "6" '
			File.Name = RootContent &"Upload\"& cstr(bNam) &"\DenCB\TEXT\"& bMa & ".VT"
			f=RootContent &"Upload\"& cstr(bNam) &"\DenCB\TEXT\"& bMa & ".VT"			
			Path=RootContent &"Upload\"& cstr(bNam) &"\DenCB\TEXT" & "\"& bMa & ".VT"
			PathAttach=RootContent &"Upload\"& cstr(bNam) &"\DenCB\"			
'Hien 25_06
		Case "7" 'ToTrinh
			PathAttach=RootContent &"Upload\"& cstr(bNam) &"\ToTrinh\"
	End Select	
	if Request("vuviec_vanthu")="den" then
		bLoaiVT=1
		File.Name = RootContent &"Upload\"& cstr(bNam) &"\Den\TEXT\"& bMa & ".VT"
		f=RootContent &"Upload\"& cstr(bNam) &"\Den\TEXT\"& bMa & ".VT"			
		Path=RootContent & "Upload\"& cstr(bNam) &"\Den\TEXT" & "\"& bMa & ".VT"			
		PathAttach=RootContent &"Upload\"& cstr(bNam) &"\den\"
	end if
'Hien 21_05
	if Request("vuviec_vanthu")="di" then
		bLoaiVt=2
		File.Name = RootContent &"Upload\"& cstr(bNam) &"\Di\TEXT\"& Replace(bMa,"/","_") & ".VT"
		f=RootContent &"Upload\"& cstr(bNam) &"\Di\TEXT\"& Replace(bMa,"/","_") & ".VT"
		Path=RootContent &"Upload\"& cstr(bNam) &"\Di\TEXT\" & Replace(bMa,"/","_") & ".VT"
		PathAttach=RootContent &"Upload\"& cstr(bNam) &"\di\"
	end if
'Hien 22_05
	if Request("vuviec_vanthu")="qd" then
		bLoaiVt=5
		File.Name =RootContent & "Upload\"& cstr(bNam) &"\Quyetdinh\TEXT\"& replace(bMa,"/","_") & ".VT"
		f=RootContent &"Upload\"& cstr(bNam) &"\Quyetdinh\TEXT\"& replace(bMa,"/","_") & ".VT"			
		Path=RootContent &"Upload\"& cstr(bNam) &"\Quyetdinh\TEXT" & "\"& replace(bMa,"/","_") & ".VT"			
		PathAttach=RootContent &"Upload\"& cstr(bNam) &"\Quyetdinh\"
	end if
	'Xem Noi dung
'Hien 25_06
if bLoaiVT="7" then		'To trinh chi co file gan kem
	sSQL="Select Tentep,mota from vanban_noidung where Mavanthu ='"& bMa &"' and Loaivanthu ='7' order by sothutu"
		Set RecT=server.CreateObject("ADODB.Recordset")
		RecT.CursorType=3
		RecT.CacheSize=5
		RecT.Open sSQL,Conn	
		if RecT.RecordCount then
			bAttach=bAttach & "<Table Width=100% border=0><TR><TD align=center><font face=Arial size=2><B>Danh s&#225;ch t&#224;i li&#7879;u g&#7855;n k&#232;m</B></font></TD></TR></Table>"
			bAttach=bAttach &"<br>"

			bAttach=bAttach & "<center><Table ><TR>"
			bCol=0
			Do while not RecT.EOF
				if bCol=5 then
					bAttach=bAttach & "</TR><TR>"
					bCol=0
				end if
					bAttach=bAttach & "<TD width=135 ><a href=OpenAttach.asp?bNam="& cstr(bnam) &"&bLoaiVT="& bLoaiVT &"&Filename=" & Session("ClsFun").mahoa(lcase(RecT("Tentep"))) & " target=New><center>"
					imgext =lcase(ExtFile(RecT("Tentep")))
					select case imgext
						case "doc"
							bAttach=bAttach & "<IMG SRC="&"..\ImageAttach\doc.gif"&" border=0>"
						case "xls"
							bAttach=bAttach & "<IMG SRC="&"..\ImageAttach\xls.gif"&" border=0>"
						case "gif","jpg","bmp","tif"
							bAttach=bAttach & "<IMG SRC="&"..\ImageAttach\gif.gif"&" border=0>"
						case "txt","log","bat"
							bAttach=bAttach & "<IMG SRC="&"..\ImageAttach\txt.gif"&" border=0>"
						case "htm","html"
							bAttach=bAttach & "<IMG SRC="&"..\ImageAttach\html.gif"&" border=0>"
						case "ppt"
							bAttach=bAttach & "<IMG SRC="&"..\ImageAttach\ppt.gif"&" border=0>"
						case "pdf"
							bAttach=bAttach & "<IMG SRC="&"..\ImageAttach\pdf.gif"&" border=0>"
						case "mdb"
							bAttach=bAttach & "<IMG SRC="&"..\ImageAttach\mdb.gif"&" border=0>"
						case "com","exe"
							bAttach=bAttach & "<IMG SRC="&"..\ImageAttach\exe.gif"&" border=0>"
						case "avi"
							bAttach=bAttach & "<IMG SRC="&"..\ImageAttach\avi.gif"&" border=0>"
						case else
							bAttach=bAttach & "<IMG SRC="&"..\ImageAttach\other.gif"&" border=0>"
					end select
					bAttach=bAttach & "<br><font face=Arial size=2>" & RecT("Mota") & "</font></center></A></TD>"
				if  Session("Attach")="" then
					Session("Attach")="-" & RecT("Tentep")
				else
					Session("Attach")=Session("Attach") & "-" & RecT("Tentep")
				end if
				RecT.MoveNext
				bCol=bCol+1
			Loop
			Session("Attach")=Session("Attach") & "-" 
			bAttach=bAttach & "</TR></Table></Center>"
		end if
		Set ClsFile=nothing%>
		<%=bAttach%>
	</Body>
<%	
else
	if File.Exists() then		
		'Call write("Nội dung văn bản: ","",1)
		Set ClsFile=server.CreateObject("Vinalines.ClsFile")
		bText=ClsFile.ReadTextFile(Path)
		sSQL="Select Tentep,mota from vanban_noidung where Mavanthu ='"& bMa &"' and Loaivanthu ='"& bLoaiVT &"' order by sothutu"
		Set RecT=server.CreateObject("ADODB.Recordset")
		RecT.CursorType=3
		RecT.CacheSize=5
		RecT.Open sSQL,Conn	
		if RecT.RecordCount then
			bAttach="<hr>"
			'#000080
			bAttach=bAttach & "<center><Table Width=100% border=1><TR bgcolor=#000080><TD align=center><font face=Arial size=2 color=#FFFFFF><strong><span >Danh s&#225;ch t&#224;i li&#7879;u g&#7855;n k&#232;m</span></strong></font></TD></TR></Table></Center>"
		
			bAttach=bAttach &"<br>"

			bAttach=bAttach & "<center><Table ><TR>"
			bCol=0
			Do while not RecT.EOF
				if bCol=5 then
					bAttach=bAttach & "</TR><TR>"
					bCol=0
				end if
					bAttach=bAttach & "<TD width=135 ><a href=OpenAttach.asp?bNam="& cstr(bnam) &"&bLoaiVT="& bLoaiVT &"&Filename=" & Session("ClsFun").mahoa(lcase(RecT("Tentep"))) & " target=New><center>"
					imgext =lcase(ExtFile(RecT("Tentep")))
					select case imgext
						case "doc"
							bAttach=bAttach & "<IMG SRC="&"..\ImageAttach\doc.gif"&" border=0>"
						case "xls"
							bAttach=bAttach & "<IMG SRC="&"..\ImageAttach\xls.gif"&" border=0>"
						case "gif","jpg","bmp","tif"
							bAttach=bAttach & "<IMG SRC="&"..\ImageAttach\gif.gif"&" border=0>"
						case "txt","log","bat"
							bAttach=bAttach & "<IMG SRC="&"..\ImageAttach\txt.gif"&" border=0>"
						case "htm","html"
							bAttach=bAttach & "<IMG SRC="&"..\ImageAttach\html.gif"&" border=0>"
						case "ppt"
							bAttach=bAttach & "<IMG SRC="&"..\ImageAttach\ppt.gif"&" border=0>"
						case "pdf"
							bAttach=bAttach & "<IMG SRC="&"..\ImageAttach\pdf.gif"&" border=0>"
						case "mdb"
							bAttach=bAttach & "<IMG SRC="&"..\ImageAttach\mdb.gif"&" border=0>"
						case "com","exe"
							bAttach=bAttach & "<IMG SRC="&"..\ImageAttach\exe.gif"&" border=0>"
						case "avi"
							bAttach=bAttach & "<IMG SRC="&"..\ImageAttach\avi.gif"&" border=0>"
						case else
							bAttach=bAttach & "<IMG SRC="&"..\ImageAttach\other.gif"&" border=0>"
					end select
					bAttach=bAttach & "<br><font face=Arial size=2>" & RecT("Mota") & "</font></center></A></TD>"
				if  Session("Attach")="" then
					Session("Attach")="-" & RecT("Tentep")
				else
					Session("Attach")=Session("Attach") & "-" & RecT("Tentep")
				end if
				RecT.MoveNext
				bCol=bCol+1
			Loop
			Session("Attach")=Session("Attach") & "-" 
			bAttach=bAttach & "</TR></Table></Center>"
		end if
		Set ClsFile=nothing
		%><%=bText%><%=bAttach%>
		<%if len(trim(bText))>2 then%>
				<p align=right><a href="#top"><FONT FACE=Arial>Trở về đầu trang</font></a>
			<%end if%>
</Body>
<%
	else
		Response.Write("&nbsp;")
		Response.Write("&nbsp;")
		Response.Write("&nbsp;")
		Response.Write("&nbsp;")
		Txt="<p align=center><Font face='Arial' size=4 color=red>V&#259;n bản n&#224;y ch&#432;a c&#243; n&#7897;i dung</font></p>"
		Response.Write(Txt)		
	end if	
	Set File = Nothing
end if
%>
<Script language=vbscript runat=server>
Function ExtFile(filename)
	dim longfilename
	dim VtCham
	longfilename=len(filename)
	VtCham=instr(1,filename,".")
	if VtCham>0 then
		ExtFile=mid(filename,VtCham+1,longfilename-VtCham)
	end if
End Function
Function write(mText,mColor,mBreak)
	if mColor="" then mColor="black"
	response.write "<font  size=2 color="& mColor &">"	
	response.write  "&nbsp;" & mText 
	response.write  "</font>"
	if mBreak=1 then	response.write   "<br>"	
End Function
Function FormatDate(vDate)
   If Not IsNull(vDate) Then
		vM = Right("0" & Month(vDate), 2)
		vD = Right("0" & Day(vDate), 2)
		vY = Right("19" & Year(vDate), 4)
		FormatDate = vD & "/" & vM & "/" & vY
   End If
End Function
Function GetName(sMa,sTen,sTable,sValue)
	sSQL="select " & sTen & " from " & sTable & " where " & sMa & " = '" &  sValue & "'"
	GetName=sSQL
	Set RecT=Server.CreateObject("ADODB.Recordset")
	RecT.CursorType=3
	RecT.CacheSize=5
	RecT.Open sSQL,Conn
	if RecT.RecordCount>0 then
		GetName=RecT(sTen)
	else 
		GetName=""
	end if
	RecT.Close
	set RecT=nothing
End Function
</Script>